package com.anda.logistics.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.anda.logistics.dao.SystemMenuDao;
import com.anda.logistics.model.SystemMenu;
import com.anda.logistics.model.SystemUser;
import com.anda.logistics.service.SystemMenuService;

@Component
public class SystemMenuServiceImpl implements SystemMenuService{
	
	private SystemMenuDao systemMenuDao;
	
	@Override
	public void save(SystemMenu systemMenu) {
		this.systemMenuDao.save(systemMenu);		
	}

	public SystemMenuDao getSystemMenuDao() {
		return systemMenuDao;
	}
	
	@Resource
	public void setSystemMenuDao(SystemMenuDao systemMenuDao) {
		this.systemMenuDao = systemMenuDao;
	}

	@Override
	public List<SystemMenu> getAll() {
		return this.systemMenuDao.getAll();
	}

	@Override
	public SystemMenu getOne(long id) {
		return this.systemMenuDao.getOne(id);
	}

	@Override
	public void deleteOne(long id) {
		this.systemMenuDao.deleteOne(id);		
	}

	@Override
	public void update(SystemMenu systemMenu) {
		this.systemMenuDao.update(systemMenu);		
	}

	@Override
	public List<SystemMenu> getUserMenus(SystemUser user) {
		return systemMenuDao.getUserMenus(user);
	}	
	
	
}
